package com.test.clyq.serviceImpl;

import java.util.Set;

import com.test.clyq.dao.DataPermissionDao;
import com.test.clyq.entity.DataPermission;
import com.test.clyq.entity.Users;
import com.test.clyq.service.DataPermissionService;
import com.test.service.impl.BaseManager;

/**
 * DataPermissionServiceImpl. <br>
 * 数据权限信息管理.
 * <p>
 * Copyright: Copyright (c) 2010-4-18 下午03:44:38
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: liuxl@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */
public class DataPermissionServiceImpl extends BaseManager implements DataPermissionService {

	private DataPermissionDao dataPermissionDao;

	public void addDataPermission(DataPermission permissin, Users user) {
		dataPermissionDao.addDataPermission(permissin, user);
	}

	public boolean delDataPermissionById(long id, Users user) {
		return dataPermissionDao.delDataPermissionById(id, user);
	}

	public Set<DataPermission> getDatePermissionByUserIdAndCategoryId(Long categoryId, Long userId) {
		return dataPermissionDao.getDatePermissionByUserIdAndCategoryId(categoryId, userId);
	}

	public void setDataPermissionDao(DataPermissionDao dataPermissionDao) {
		this.dataPermissionDao = dataPermissionDao;
	}
}
